package com.chen.dao;

import com.chen.bean.Blog;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface BlogMapper {
    void insertContent(Blog blog);

    void updateById(Blog blog);

    List<String> getLabelByUser(String username);

    List<String> getTitleByLabelAndUser(@Param("label") String label,@Param("username") String username);

    String getContentByTitle(String title);

    Blog getBlogDetails(String title);

    List<Blog> getBlogIntroduction();

    List<Blog> getBlogIntroByLabel(Map<String,Object> map);

    Integer getNumByLabel(String label);

    List<String> getLabelByNum();

    List<String> getTitleByNum();

    Integer existStar(@Param("title") String title,@Param("username") String username);

    void deleteStar(@Param("title") String title,@Param("username") String username);

    void increaseStar(@Param("title") String title,@Param("username") String username);

    Integer getTotalNumStar(String username);

    List<Blog> getStarBlogList(@Param("username") String username,@Param("offset") Integer offset,@Param("pageSize") Integer pageSize);
}
